/**
 * 游戏界面 包括砖块地图和人物移动模块
 */
class gameScene extends Frame.Game.Scene {
    init() {
        let sceneModel = new gameModel();
        //注册模块
        Frame.MVC.registController(ModuleKey.game, new gameController(), new gameView(), sceneModel);
        Frame.MVC.registController(ModuleKey.endWindow, new endWindowController(), new endWindowView(), sceneModel);



        //注册监听
        Frame.Message.addListener("gameOver", this.openEndWindow, this);
    }
    open() {
        //添加该场景需要的显示层
        this.openLayer(Frame.Display.Layer.gameContent);
        this.openLayer(Frame.Display.Layer.UI);
        //开启view
        this.loadResAndOpenView(ModuleKey.game, Frame.Display.Layer.gameContent, "game");
    }
    private openEndWindow() {
        //开启end view
        this.openView(ModuleKey.endWindow, Frame.Display.Layer.UI);
    }

}